import * as type from '../action-type.js'

export default {
    getLogin() {
        return function (dispatch, getState, request) {
            // 经过 thunk 处理后 返回。
            return request.get('/api/login').then((res) => {
                let list = res.data;
                console.log(list, 'list')
                dispatch({
                    type: type.SET_LOGIN,
                    login: list
                })
            })
        }
    }
}